package system.train;

import java.util.LinkedList;
import system.track.Block;
import system.track.Direction;
import system.track.IllegalFunctionCallException;

/**
 * This is the Train interface.
 * 
 * @author Yasmine Kandissounon
 * @version Cycle 1 - complete
 */
public interface Train
{
    /**
     * Sets the Route that the train will follow, which 
     * determines the train's actions.
     * 
     * @param direction the Direction the train will travel,
     * given as clockwise or counterclockwise
     */
    public Route setRoute(Direction direction);

    /**
     * Sets the Direction that the train will travel.
     * 
     * @param direction the Direction the train will travel,
     * given as clockwise or counterclockwise
     */
    public void setDirection(Direction direction);
    
    /**
     * Returns the current direction the train is headed.
     * 
     * @return  a Direction indicating clockwise or counterclockwise
     */
    public Direction getDirection();
    
    /**
     * Returns the Block where the train is currently located.
     * 
     * @return  the Block where the train is
     */
    public Block getCurrentBlock();
    
    /**
     * Sets the current location of the train to a specific Block.
     * Used to initialize the location of the train.
     * 
     * @param block a Block where the train is located
     */
    public void setCurrentBlock(Block block);
    
    /**
     * Sets the train's speed.
     * 
     * @param speed an int from 1 to 7
     */
    public void setSpeed(int speed);
    
    /**
     * Returns the speed the train is travelling.
     * 
     * @return  an int from 1 to 7 indicating the speed of the train
     */
    public int getSpeed();
    
    /**
     * Halts the train, or sets the speed to 0.
     */
    public void stop();
    
    /**
     * Fires the trip action on a Sensor as the train passes over it.
     */
    public void tripSensor();
}
